package dome1;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 王圆豪
 * Date: 2024-05-29
 * Time: 22:13
 */
public class Main {
    //7-35 方阵转置
    public static void main(String[] args) {

    }
    //7-34 数组元素的删除
    public static void del(int[] array, int pos) {
        for (int i = pos; i < array.length - 1; i++) {
            array[i] = array[i + 1];
        }
    }
    public static void main6(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();;
        }
        int m = sc.nextInt();
        for (int i = 0; i < m; i++) {
            int pos = sc.nextInt() - 1;
            del(array, pos);
        }
        for (int i = 0; i < array.length - m - 1; i++) {
            System.out.print(array[i] + " ");
        }
        System.out.print(array[array.length - 1 - m]);
    }
    //7-33 sdut-array1-2 体育课一列纵队分两列（II）
    public static void main5(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        System.out.print(array[0]);
        for (int i = 2; i < n ; i+=2) {
            System.out.print(" " + array[i]);
        }
        System.out.println();
        System.out.print(array[1]);
        for (int i = 3; i < n; i+=2) {
            System.out.print(" " + array[i]);
        }
    }
    //7-32 结伴同行去秋游
    public static void main4(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        for (int i = 0; i < n / 2; i++) {
            System.out.println(array[i] + " " + array[n - 1 - i]);
        }
    }
    //7-31 摘苹果
    public static void main3(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        int height = sc.nextInt();
        height += 30;
        int count = 0;
        for (int i = 0; i < n; i++) {
            if (array[i] <= height) {
                count++;
            }
        }
        System.out.println(count);
    }
    //7-30 排序
    public static void main2(String[] args) {
        int[] array = new int[10];
        Scanner sc = new Scanner(System.in);
        for (int i = 0; i < 10; i++) {
            array[i] = sc.nextInt();
        }
        for (int i = 0; i < array.length - 1; i++) {
            for (int j = 0; j < array.length - 1 - i; j++) {
                if (array[j] > array[j + 1]) {
                    int tmp = array[j];
                    array[j] = array[j + 1];
                    array[j + 1] = tmp;
                }
            }
        }
        for (int i = 0; i < 9; i++) {
            System.out.print(array[i] + " ");
        }
        System.out.print(array[9]);
    }
    //7-29 sdut-array1-1-有重复的数据（II）
    public static void main1(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] array = new int[n];
        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
        }
        int i;
        for (i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                if (array[i] == array[j]) {
                    i = n;
                    break;
                }
            }
        }
        if (i == n + 1) {
            System.out.println("YES");
        } else {
            System.out.println("NO");
        }
    }
}
